<script setup lang="ts">
	import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";
	onLaunch(() => {
		console.log("App Launch");
	});
	onShow(() => {
		console.log("App Show");
	});
	onHide(() => {
		console.log("App Hide");
	});

	import { useAuthStore } from "@/stores/auth";
	const authStore = useAuthStore();
	const getTheme = authStore.getTheme();
	const globalBgColor = getTheme.backgroundColor;
	function setGlobalGradientBackground(gradient : string | null) {
		// 动态修改CSS变量
		document.documentElement.style.setProperty("--global-gradient-bg", gradient);
	}
	setGlobalGradientBackground(globalBgColor);
</script>

<style lang="scss">
	#app,
	body,
	page {
		color: #333333;
		background-color: #f1f4f9;
		background-image: var(--global-gradient-bg);
		background-size: 100vw 100vh;
		min-height: 100vw;
		background-repeat: no-repeat;
	}

	#app {
		padding: 0 2vw;
	}
</style>